//
//  LZXHelper.h
//  Connotation
//
//  Created by Xuan on 14-5-20.
//  Copyright (c) 2014年 Xuan. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

@interface LZXHelper : NSObject
//把一个秒字符串 转化为真正的本地时间
//@"1419055200" -> 转化 日期字符串
+ (NSString *)dateStringFromNumberTimer:(NSString *)timerStr;
//根据字符串内容的多少  在固定宽度 下计算出实际的行高
+ (CGFloat)textHeightFromTextString:(NSString *)text width:(CGFloat)textWidth fontSize:(CGFloat)size;
//动态计算行宽
+ (CGFloat)textWidthFromTextString:(NSString *)text Height:(CGFloat)textHeight fontSize:(CGFloat)size;

//计算富文本字体高度
/**
 *  计算富文本字体高度
 *
 *  @param lineSpeace 行高
 *  @param font       字体
 *  @param width      字体所占宽度
 *
 *  @return 富文本高度
 */

+ (CGFloat)getAttributedStringHeightwithSpeace:(CGFloat)lineSpeace withFont:(UIFont*)font withWidth:(CGFloat)width attributedString:(NSString *)attributedString;

//获取 当前设备版本
+ (double)getCurrentIOS;
//获取当前设备屏幕的大小
+ (CGSize)getScreenSize;

//获得当前系统时间到指定时间的时间差字符串,传入目标时间字符串和格式
+(NSString*)stringNowToDate:(NSString*)toDate formater:(NSString*)formatStr;

+(NSString*)stringNowToDate:(NSDate*)toDate;

//获取缓存文件 在 沙盒 Library/Caches 中的路径

+ (NSString *)getFullCacheFilePathWithUrl:(NSString *)url;
//判断 缓存文件 是否 超时  第二个参数 可以设置超时时间
+ (BOOL)isOutTimeOfFileWithUrl:(NSString *)url outTime:(NSTimeInterval) time;

+ (NSString *)numOfATimerToNow:(NSString *)timer;

+ (NSString *)getTimeStrWithOldDateFomatter:(NSString *)oldFormatterStyle DateStr:(NSString *)date newFormatter:(NSString *)newFormatter;
//判断输入文字是否为空
+ (BOOL)isEmpty:(NSString *) str;
//总容量
+ (CGFloat )totalDiskSpace;
//可用容量
+ (CGFloat )freeDiskSpace;
//
//- (NSString *)getFilePath:(NSString *)URL;
//颜色转换
+ (UIColor *)HexColorToRedGreenBlue:(NSString *)hexColorString;

+ (NSString *)timeWithDate:(NSDate *)date;
//加载框
+ (void)postLoadViewWithText:(NSString *)message View:(UIView *)view;

//隐藏加载框
+ (void)hideLoadViewWithView:(UIView *)view;

//弹出提示框
+ (void)postMessageWithText:(NSString *)message View:(UIView *)view;

//详情弹出框
+ (void)postDetailMessageWithText:(NSString *)message View:(UIView *)view;
//获得星期
+ (NSString *)stringedWeekday:(NSUInteger)weekday;
//获取IP
+ (NSString *)getIPStr;
//获取端口号
+ (NSString *)getPortStr;
//过去服务器地址
+ (NSString *)getServerURL;
//获得UUID
+ (NSString *)getUuidWithKeyChain;
//获取用户类型
+ (NSString *)getUserType;
//获取sessionId
+ (NSString *)getSessionID;
//获取用户姓名
+ (NSString *)getUserName;
//获取用户所在组
+ (NSString *)getUserDepartName;
//弹出alertView
+ (void)postAlertViewControllerWithTitle:(NSString *)title message:(NSString *)message cancelButtonTitle:(NSString *)cancelButtonTitle otherButtonTitle:(NSString *)otherButtonTitle cancelEvent:(void (^)())cancelBlock otherEvent:(void (^)())otherBlock viewController:(id)viewController;
//获取若干天前后的日期
+ (NSString *)getEndDateStrWithDays:(CGFloat)days isBefore:(BOOL)isBefore;

// 获取当前周的周一的时间
+ (NSString *)getFirstWeekTime;

// 获取当前周日的时间
+ (NSString *)getLastWeekTime;
//获取当月第一天日期
+ (NSString *)getFirstDayInMonth;

//获取当月最后一天日期
+ (NSString *)getLastDayInMonth;

//获取上月最后一天日期
+ (NSString *)getLastDayInLastMonth;

//获取上月第一天日期
+ (NSString *)getFirstDayInLastMonth;

//获取本季度第一天日期
+ (NSString *)getFirstDayWithQuarter;

//获取本季度最后一天日期
+ (NSString *)getLastDayWithQuarter;

//获取上下半年第一天日期
+ (NSString *)getFirstDayWithHalfAYear;

//获取上下半年最后一天日期
+ (NSString *)getLastDayWithHalfAYear;

//获取上季度第一天日期
+ (NSString *)getFirstDayWithLastQuarter;

//获取上季度最后一天日期
+ (NSString *)getLastDayWithLastQuarter;

//获取上半年第一天日期
+ (NSString *)getFirstDayWithFirstHalfAYear;

//获取上半年最后一天日期
+ (NSString *)getLastDayWithFirstHalfAYear;

//获取下半年第一天日期
+ (NSString *)getFirstDayWithSecondHalfAYear;

//获取下半年最后一天日期
+ (NSString *)getLastDayWithSecondHalfAYear;

//两个时间的时间差
+ (NSString *)getDaysWithBeginTime:(NSString *)beginStr endTime:(NSString *)endStr;//

//根据componentsStr切割string
+ (NSArray *)getArrWithStr:(NSString *)string componentsStr:(NSString *)componentsStr;
@end





